import request from '@/api/request'

/**
 * 获取地址列表
 * @returns
 */
export function findReturnApply() {
  return request({
    url: `/lejuAdmin/companyAddress/addressList`
  })
}

/**
 *
 * 新增&修改地址
 * @param {*} data
 * @returns
 */
export function saveAddress(data) {
  return request({
    url: '/lejuAdmin/companyAddress/save',
    method: 'post',
    data
  })
}

/**
 * 更新修改地址
 * @param {*} data
 * @returns
 */
export function updateAddress(data) {
  return request({
    url: '/lejuAdmin/companyAddress/update',
    method: 'post',
    data
  })
}

/**
 *设置默认收货地址
 * @param {*} data
 * @returns
 */
export function setReceiveOne(data) {
  return request({
    url: '/lejuAdmin/companyAddress/setReceiveOne',
    method: 'post',
    data
  })
}

/**
 * 设置默认发货地址
 * @param {*} data
 * @returns
 */

export function setSendOne(data) {
  return request({
    url: '/lejuAdmin/companyAddress/setSendOne',
    method: 'post',
    data
  })
}

/**
 * 获取地址详情
 * @param {*} id
 * @returns
 */
export function companyAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`
  })
}

/**
 * 删除地址
 * @param {*} id
 * @returns
 */
export function delAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'delete'
  })
}
